package com.sgb.kjwl.api.service;

import com.sgb.kjwl.model.EnquiryImAlternateEntity;
import com.sgb.kjwl.model.entity.AdvertisementEntity;
import com.sgb.kjwl.model.entity.BossEntity;
import com.swgk.core.view.entity.ChannelEntity;
import com.sgb.kjwl.model.entity.DemandHallListEntity;
import com.sgb.kjwl.model.entity.DemandPublishEntity;
import com.sgb.kjwl.model.entity.EnquiryTypeEntity;
import com.sgb.kjwl.model.entity.ImAccountBean;
import com.swgk.core.base.model.factory.BaseUrlInterceptor;
import com.swgk.core.view.entity.MenuEntity;
import com.sgb.kjwl.model.entity.NeedsEntity;
import com.sgb.kjwl.model.entity.ParentAreaEntity;
import com.sgb.kjwl.model.entity.ProvinceEntity;
import com.sgb.kjwl.model.entity.RecommendEntity;
import com.sgb.kjwl.model.entity.SelfOpenAccountDetailEntity;
import com.sgb.kjwl.model.entity.ServiceAreaEntity;
import com.sgb.kjwl.model.entity.StoreEntity;
import com.sgb.kjwl.model.entity.home.CityEntity;
import com.sgb.kjwl.model.entity.shopping.ShopInfoPublishEntity;
import com.sgb.kjwl.model.entity.supplier3.DictEntity3;
import com.sgb.kjwl.model.entity.transport.CategoryItem;
import com.sgb.link.entity.AreaEntity;
import com.swgk.core.base.model.entity.BaseEntity;
import com.swgk.core.base.model.entity.ListResponse;

import java.util.List;
import java.util.Map;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

public interface CommonAPI {

    //获取当前地址编码
    @POST("v1/app/common/getLocation")
    Call<BaseEntity<List<ProvinceEntity<List<ProvinceEntity>>>>> getCurrentArea();

    //获取当前IP定位城市
    @POST("v1/app/common/getCityLocation")
    Call<BaseEntity<CityEntity>> getCurrentCity();

    //获取城市列表数据
    @POST("v1/app/common/getCityList")
    Call<BaseEntity<List<CityEntity>>> getCityList();

    //请求二级地区列表
    @FormUrlEncoded
    @POST("v1/app/common/getAreaSecond")
    Call<BaseEntity<List<AreaEntity>>> getAreaSecond(@Field("areaCode") String areaCode);

    //请求二级地区列表（工队）
    @FormUrlEncoded
    @POST("v1/app/common/getAreaSecond")
    Call<BaseEntity<List<ServiceAreaEntity>>> getTeamAreaSecond(@Field("areaCode") String areaCode);

    //请求二级和三级地区列表（工程机械的筛选）
    @FormUrlEncoded
    @POST("v1/app/common/getAreaSecondAndThird")
    Call<BaseEntity<List<ParentAreaEntity<List<ParentAreaEntity>>>>> getAreaSecondAndThird(@Field("areaCode") String areaCode);

    //设置IM手机号
    @FormUrlEncoded
    @POST("v1/app/common/openIm")
    Call<BaseEntity<ImAccountBean>> setIMMobile(@Field("mobile") String mobile);

    //获取广告数据
    @GET("v1/app/advertisement/getTwinkleAdvertisement")
    Call<BaseEntity<AdvertisementEntity>> getTwinkleAdvertisement();

    //首页标签
    @Headers({BaseUrlInterceptor.HEADERS_URL_HOME, "tokenType:pc"})
    @GET("v1/app/index/list")
    Call<BaseEntity<List<ChannelEntity>>> getChannelList();

    //首页推供应商
    @FormUrlEncoded
    @POST("v1/app/material/buyer/recommandSupplier")
    Call<BaseEntity<List<BossEntity>>> getRecommandSupplier(@Field("areaCode") String areaCode);

    //首页推供应商 版本2
    @POST("v1/app/material/buyer/recommandSupplierV2")
    Call<BaseEntity<List<BossEntity>>> getRecommandSupplier2(@Body Map map);

    //首页发现应商
    @POST("v1/app/material/buyer/findSupplier")
    Call<BaseEntity<List<BossEntity>>> findSupplier(@Body Map map);

    //首页推荐商品
    @FormUrlEncoded
    @POST("v1/app/material/buyer/recommandGoods")
    Call<BaseEntity<List<RecommendEntity>>> getRecommandGoods(@Field("areaCode") String areaCode, @Field("limitNum") int limitNum);

    //需求列表
    @POST("v1/app/user/needs/list")
    Call<BaseEntity<ListResponse<List<NeedsEntity>>>> getNeedsList(@Body Map map);

    //需求列表-首页
    @POST("v1/app/material/seller/needsList")
    Call<BaseEntity<ListResponse<List<NeedsEntity>>>> getHomeNeedsList(@Body Map map);

    //需求-详情
    @FormUrlEncoded
    @POST("v1/app/user/needs/needsDetail")
    Call<BaseEntity<DemandPublishEntity>> getNeedsDetail(@Field("no") String no);

    //需求-发布
    @POST("v1/app/user/needs/save")
    Call<BaseEntity> saveDemand(@Body DemandPublishEntity demandPublishEntity);

    //需求-status:1上架  2下架
    @FormUrlEncoded
    @POST("v1/app/user/needs/upDown")
    Call<BaseEntity> upDown(@Field("no") String no, @Field("status") String status);

    //需求-删除
    @FormUrlEncoded
    @POST("v1/app/user/needs/delete")
    Call<BaseEntity> delete(@Field("no") String no);

    //搜索-店铺列表
    @FormUrlEncoded
    @POST("v1/app/material/buyer/storeSearch")
    Call<BaseEntity<ListResponse<List<StoreEntity>>>> storeSearch(@Field("areaCode") String areaCode, @Field("text") String text, @Field("pageNum") int pageNum, @Field("pageSize") int pageSize);

    //搜索-商品列表
    @FormUrlEncoded
    @POST("v1/app/material/buyer/goodsSearch")
    Call<BaseEntity<ListResponse<List<RecommendEntity>>>> goodsSearch(@Field("areaCode") String areaCode, @Field("text") String text, @Field("pageNum") int pageNum, @Field("pageSize") int pageSize);

    //首页搜索一级类目
    @POST("v2/app/index/searchCategoryItems")
    Call<BaseEntity<List<CategoryItem>>> searchCategoryItems();

    //共同根据areaCode查地区
    @POST("v1/app/material/buyer/goodsChoose")
    Call<BaseEntity<List<DictEntity3>>> getAreaFilterByCode(@Query("areaCode") String areaCode);

    //需求大厅材料类型
    @POST("v1/app/material/firstCategory")
    Call<BaseEntity<List<DictEntity3>>> getDemandHall(@Query("areaCode") String areaCode);

    //需求大厅状态类型
    @POST("v1/app/material/demandHall/getEnquiryType")
    Call<BaseEntity<List<EnquiryTypeEntity>>> getEnquiryType();

    //需求大厅用户类型
    @POST("v1/app/material/demandHall/getUserType")
    Call<BaseEntity<List<EnquiryTypeEntity>>> getUserType();

    //需求大厅排序类型
    @POST("v1/app/material/demandHall/getSortType")
    Call<BaseEntity<List<EnquiryTypeEntity>>> getSortType();

    //需求大厅数据列表信息
    @POST("v1/app/material/demandHall/enquirySearch")
    Call<BaseEntity<ListResponse<List<DemandHallListEntity>>>> getDemandHallList(@Body Map map);

    //会员经营首页分类接口
    @GET("v1/app/member/getMemberCateGory")
    Call<BaseEntity<List<MenuEntity<MenuEntity<MenuEntity>>>>> getMemberCategories();

    //开户详情
    @GET("v1/account/detail")
    Call<BaseEntity<SelfOpenAccountDetailEntity>> getCompanyDetail();

   //询价详情获取IM
    @GET("v1/app/imAlternate/enquiryImAlternate/{no}")
    Call<BaseEntity<EnquiryImAlternateEntity>> enquiryImAlternate(@Path("no") String no);

   //询价-报价详情获取IM
    @GET("v1/app/imAlternate/enquiryOrQuoteImAlternate/{no}/{type}")
    Call<BaseEntity<EnquiryImAlternateEntity>> enquiryOrQuoteImAlternate(@Path("no") String no,@Path("type") String type);

    //商铺经营-我的详情修改
    @POST("v1/app/user/goods/quote/quotePublish")
    Call<BaseEntity> getQuotePublish(@Body List<ShopInfoPublishEntity> shopinfopublishentity);

    /**
     * 商品详情获取IM列表
     */
    @GET("v1/app/imAlternate/itemImAlternate/{no}/{type}")
    Call<BaseEntity<EnquiryImAlternateEntity>> itemImAlternate(@Path("no") String no, @Path("type") Integer type);
    //会员经营-获取审批流程状态
    @Headers({BaseUrlInterceptor.HEADERS_URL_MEMBER, "tokenType:pc"})
    @GET("v1/app/user/member/getProcessStatus")
    Call<BaseEntity<Object>> getProcessStatus(@Query("companyNo") String companyNo, @Query("approveType") String approveType);

}
